﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Weibo4Sharp.Model;
using Hammock.Web;

namespace Weibo4Sharp.Service
{
    public partial class WeiboService
    {
        public WeiboPrivacy GetPrivacy()
        {
            return WithHammock<WeiboPrivacy>(
                "account/get_privacy", FormatAsString);                
        }

        public WeiboPrivacy UpdatePrivacy(int comment = 0, int message = 1, int realName = 1, int geo = 0, int badge = 0)
        {

            return WithHammock<WeiboPrivacy>(WebMethod.Post,
                "account/update_privacy", FormatAsString,
                "?comment=", comment,
                "&message=", message,
                "&real_name=", realName,
                "&geo=", geo,
                "&badge=", badge);               
        }

        public WeiboPrivacy UpdatePrivacy(WeiboPrivacy privacy)
        {
            return UpdatePrivacy(privacy.Comment, privacy.DirectMessage, privacy.RealName, privacy.Geo, privacy.Badge);
        }
    }
}
